package com.neelsys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.neelsys.domain.ui.JSONGraph;
import com.neelsys.service.VisualisationService;

/**
 * Handles and retrieves the login or denied page depending on the URI template
 */
@Controller
public class VisualController {

	@Autowired
	VisualisationService visualSvc;

	

	@RequestMapping(value = "/college/populate", method = RequestMethod.POST, headers = "Accept=application/json")
	public @ResponseBody
	JSONGraph persistCourseDesig() {
		System.out.println("College Save Called");

		return visualSvc.persistCourseDesig();

	}

	@RequestMapping(value = "/college/get", method = RequestMethod.GET)
	public @ResponseBody
	JSONGraph getCollege() {

		return visualSvc.getCollege();
	}



	@RequestMapping(value = "/college/jsontest", method = RequestMethod.GET, headers = "Accept=application/json")
	public @ResponseBody
	JSONGraph getDummyJsonData() {

		JSONGraph jsonGraph = visualSvc.getDummyJsonGraph();

		return jsonGraph;

	}
}